<template>
  <div>
    <!--条件筛选-->
    <TopFilter ref="topFilter" :list="topFilterList" :cols="3" labelWidth="110" @filterChange="changeHandle" @onCollapse="collapseHandle"></TopFilter>
    <!-- table -->
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :datakey="'records'"
      :isSelectColumn="false"
      :onColumnsChange="columns => this.columns = columns"
    >
    </FilterTable>

  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { getGradeData } from '@/api/assessgrade/grade/lowscore';
import {xsArr} from "./constant";
import {mxddztArr} from "../../../partsmanage/purchaseManage/purchaseSubmit/constant";

export default {
  name: "saleLowScoreQuery",
  mixins: [dictionary],
  components: {},
  data() {
    return{
      topFilterList: this.createTopFilterList(),
      columns: this.createTableColumns(),
      fetchApi: getGradeData,
      issearch: false,
      fetchParams: {
        xhrAbort: true,
      },
    };
  },
  created() {
  },
  methods: {
    createTopFilterList() {
      return[
        {type: 'SELECT', label: '评价场景', fieldName: 'afpjcj', placeholder: '请选择', itemList: xsArr},
        {type: 'RANGE_DATE', label: '评价日期', fieldName: 'afpjrq1|afpjrq2', valueFormat: 'yyyy-MM-dd', placeholder: '请选择'},
      ]
    },
    createTableColumns () {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '评价单号',
          dataIndex: 'afpjid',
          sorter: true,
        },
        {
          title: '评价场景',
          dataIndex: 'afpjcj',
          sorter: true,
          dictItems: xsArr,
        },
        {
          title: '评价对象机构',
          dataIndex: 'afjgmc',
          sorter: true,
        },
        {
          title: '评价分数',
          dataIndex: 'afpjfs',
          sorter: true,
        },
        {
          title: '评价人',
          dataIndex: 'afpjry',
          sorter: true,
        },
        {
          title: '评价人电话',
          dataIndex: 'afpjdh',
          sorter: true,
        },
        {
          title: '评价日期',
          dataIndex: 'afpjrq',
          sorter: true,
        },
        {
          title: '描述',
          dataIndex: 'afpjms',
          sorter: true,
        },
      ]
    },
    seacherFun(){
      this.issearch = true
    },
    changeHandle(val) {
      this.isOpen=true;
      this.fetchParams = Object.assign({}, val);
      this.fetchParams.afywfw = '销售'
    },
    collapseHandle() {
      this.$nextTick(() => {
        this.BaseTable.EXECUTE_RESET_HEIGHT();
      });
    },
  }
}
</script>

<style scoped>

</style>
